"""Build DAOS client"""

import os


def scons():
    """Execute build"""

    Import("prereqs", "env")

    if not (prereqs.client_requested() or prereqs.server_requested()):
        return

    SConscript("array/SConscript")
    SConscript("kv/SConscript")
    SConscript("api/SConscript")
    if prereqs.client_requested():
        SConscript("dfs/SConscript")
        SConscript("dfuse/SConscript")
        SConscript("serialize/SConscript")
        SConscript("ds3/SConscript")

        SConscript("pydaos/SConscript")
        env.Install(os.path.join("$PREFIX", "lib/daos/python"), "setup.py")


if __name__ == "SCons.Script":
    scons()
